import request from '@/utils/request'

//获取章节列表
export function getAllChapterVideo(courseId) {
    return request({
      url: `/eduService/edu-chapter/getChapterVideo/${courseId}`,
      method: 'get',
    })
  }

//添加章节
export function addChapter(chapter) {
  return request({
    url: `/eduService/edu-chapter/addChapter`,
    method: 'post',
    data:chapter
  })
}

//根据id查询章节
export function getChapter(chapterId) {
  return request({
    url: `/eduService/edu-chapter/getChapterInfo/${chapterId}`,
    method: 'get',
  })
}

//修改章节
export function updateChapter(chapter) {
  return request({
    url: `/eduService/edu-chapter/updateChapter`,
    method: 'post',
    data:chapter
  })
}

//删除章节
export function deleteChapter(chapterId) {
  return request({
    url: `/eduService/edu-chapter/${chapterId}`,
    method: 'delete'
  })
}